package com.itheima.huikebackend.context;


import java.util.Map;

public class BaseContext {

    public static ThreadLocal<Map<String,String>> threadLocal = new ThreadLocal<>();

    public static void setCurrentInfo(Map<String,String> map) {
        threadLocal.set(map);
    }

    public static String getCurrentId() {
        Map<String,String> map = threadLocal.get();
        return map.get("id");
    }

    public static String getCurrentName() {
        Map<String,String> map = threadLocal.get();
        return map.get("userName");
    }
    public static String getCurrentDeptId() {
        Map<String,String> map = threadLocal.get();
        return map.get("deptId");
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
